home *** CD-ROM | disk | FTP | other *** search
- /*
- Sample ICI script for NetFinder.
-
- This script demonstrates how to customize the command key shortcuts
- used to quickly access a menu command.
-
- Cool Idea:
- Move this script into the "NetFinder Startup Items" folder and have your
- command key shortcuts always loaded upon application startup.
- Of course the ICILib script engine must be installed.
-
- NOTES:
- o Full ICI programming syntax can be obtained from
- <http://www.zeta.org.au/~atrn/ici/documentation.html>
-
- (c) Copyright 2000 Peter Li.
-
- ========================================================================
- Like the method used to set command key shortcuts for scripts
- (summarized below) we use the same format to re-define command
- key shortcuts for existing menu commands.
-
- eg if "My HTML Pages URL\aocsP" is the filename of a Shortcut on disk.
- Then the menu item will be shown as "My HTML Pages URL" with the command
- key being APPLE + OPTION + CONTROL + SHIFT and the letter "P"
-
- where \ = command/modifier key sequence begin tag
- a = Apple Key Modifier
- o = Option Key Modifier
- c = Control Key Modifier
- s = Shift Key Modifier
- P = command key to use, in this case the letter 'P'.
- NOTE: the order of modifiers is important.
-
- =======================================================================
- Note in this script, we use constants like kCmdNewFolder or we can use
- a raw form OSType("NDir"). The advantage of the latter is that we dont
- need to load the constants via the NFLoadModuleConstants() call.
- This is only a concern if speed is an issue. Using the constants makes
- the script a bit more readable.
-
- Also note, we use two \ characters instead of one, because the \ character
- is a special character that is interpreted differently in a script when
- inside a quoted string.
-
- For more information on all the available constants used by all the commands
- in the various menus in NetFinder, please read the documentation named
- "Inside NetFinder for ICI.html" found in the Modules folder.
- */
-
- /* load in some constants exported by NF, so we dont have to use numbers */
- NFLoadModuleConstants();
-
- /*
- Uncomment the following line (remove the "//" characters) to make
- the command key shortcut for New Directory be OPTION+N as opposed
- to the default APPLE+N.
- */
-
- //NFSetModifiersForCommand(OSType("NDir"), "\\oN"); /* OPTION + N */
-
-
- /*
- The following lines defines entirely new command shortcuts to
- commands that previously didnt have a command key shortcut.
- You are more than welcome to add or alter any command key
- shortcuts you like.
- */
-
- // View Sub Menu Additions
- NFSetModifiersForCommand(kCmdViewInBrowser, "\\asB"); /* APPLE + SHIFT + B */
-
- // Edit Menu Additions
- NFSetModifiersForCommand(kCmdSetPermissions, "\\oP"); /* OPTION + P */
-
-
- // Windows Menu Additions
- NFSetModifiersForCommand(kCmdShowTranscriptWin, "\\o1"); /* OPTION + 1 */
- NFSetModifiersForCommand(kCmdShowTransferLogWin, "\\o2"); /* OPTION + 2 */
- NFSetModifiersForCommand(kCmdShowPartialFileWin, "\\o3"); /* OPTION + 3 */
-
- // Shortcuts/Favorites Menu Additions
- NFSetModifiersForCommand(kCmdAddToFavorites, "\\oA"); /* OPTION + A */
-
- // ======================================================================
-
- auto GLYPH_COMMAND = "";
- auto F1 = 111;
- auto F2 = 112;
- auto F3 = 113;
- auto F4 = 114;
- auto F5 = 115;
- auto F6 = 116;
- auto F7 = 117;
- auto F8 = 118;
- auto F9 = 119;
- auto F10 = 120;
- auto F11 = 121;
- auto F12 = 122;
- auto F13 = 135;
- auto F14 = 136;
- auto F15 = 137;
-
- // Change the following from 0 to 1 to setup Windoze like keys bindings.
- auto SIMULATE_WINDOWS = 0;
-
- if (SIMULATE_WINDOWS)
- {
- // remap the label command keys, otherwise they will conflict.
- NFSetModifiersForCommand(kCmdLabelNone, "\\" + GLYPH_COMMAND);
- NFSetGlyphForCommand(kCmdLabelNone, F13);
-
- // F4 -> refresh window
- // Dont know why using F5 does not work!?
- NFSetModifiersForCommand(kCmdRefreshSelection, "\\" + GLYPH_COMMAND); /* KEY */
- NFSetGlyphForCommand(kCmdRefreshSelection, F4); /* Setup Glyph for F5 */
-
- // ALT + F4 -> close window
- NFSetModifiersForCommand(kCmdFileClose, "\\o" + GLYPH_COMMAND); /* OPTION + KEY */
- NFSetGlyphForCommand(kCmdFileClose, F4); /* Setup Glyph for F4 */
-
- }
-